package thread.waitnotifypackage;

import java.util.LinkedList;
import java.util.Queue;

public class ProducerConsumer {
    private static final int CAPACITY = 5;

    public static void main(String[] args) {
        Queue<Integer> queue = new LinkedList<>();

        Thread producerA = new Producer(queue, "P-1", CAPACITY);
        Thread producerB = new Producer(queue, "P-2", CAPACITY);
        Thread producerC = new Producer(queue, "P-3", CAPACITY);
        Thread consumerA = new Consumer(queue, "C-1", CAPACITY);
        Thread consumerB = new Consumer(queue, "C-2", CAPACITY);
        Thread consumerC = new Consumer(queue, "C-3", CAPACITY);

        consumerA.start();
        producerA.start();
        producerB.start();
        consumerB.start();
        producerC.start();
        consumerC.start();

    }
}
